import m.server.TcpServer;
import m.system.listener.InitListener;
import m.system.util.SystemUtil;

public class Start {
	public static void main(String[] a) throws Exception {
		int port=9999;
		if(a.length>0&&a[0].matches("[0-9]*")) {
			port=Integer.parseInt(a[0]);
		}
		String path=Start.class.getProtectionDomain().getCodeSource().getLocation().getPath();
		String jar=path.substring(path.lastIndexOf("/")+1);
		path=path.substring(0, path.lastIndexOf("/")+1);
		SystemUtil.printlnIf(true,"启动目录:",path,",Jar:",jar);
		boolean flag=InitListener.init(path);
		if(flag) TcpServer.start(port);
	}
}
